﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Dora.Tools.Utility.Const.ApiSetting
{
    /// <summary>
    /// 环信资源文件
    /// </summary>
    public class EasemobConstValue
    {
        #region 配置
        /// <summary>
        /// 
        /// </summary>
        public static string BaseUrl => "https://a1.easemob.com";
        /// <summary>
        /// 
        /// </summary>
        public static string AppKey => "1104190513055659#dora-test";
        /// <summary>
        /// 
        /// </summary>
        public static string Orgname => "1104190513055659";
        /// <summary>
        /// 
        /// </summary>
        public static string Appname => "dora-test";
        /// <summary>
        /// 
        /// </summary>
        public static string ClientID => "YXA6rTYLAHV-EemO5JNiyg5c5w";
        /// <summary>
        /// 
        /// </summary>
        public static string ClientSecret => "YXA68uWZi1HBgFCnSW_gmQWHuDmYLeQ";
        #endregion

        #region URL

        public static string UrlBase { get { return string.Format("/{0}/{1}/", Orgname, Appname); } }

        /// <summary>
        /// 获取Token的URL
        /// </summary>
        public static string UrlGetToken
        {
            get { return string.Format("{0}{1}", UrlBase, "token"); }
        }

        #region 用户体系

        #region IM 用户管理

        /// <summary>
        /// 注册 IM 用户的URL
        /// </summary>
        public static string UrlCreateUsers
        {
            get { return string.Format("{0}{1}", UrlBase, "users"); }
        }

        /// <summary>
        /// 获取 IM 用户[单个]的URL
        /// </summary>
        public static string UrlGetUser
        {
            get { return string.Concat(UrlBase, "users/{0}"); }
        }

        /// <summary>
        /// 获取 IM 用户[批量]的URL
        /// </summary>
        public static string UrlGetUsers
        {
            get { return string.Concat(UrlBase, "users?limit={0}&cursor={1}"); }
        }

        /// <summary>
        /// 删除 IM 用户[单个]的URL
        /// </summary>
        public static string UrlDeleteUser
        {
            get { return string.Concat(UrlBase, "users/{0}"); }
        }

        /// <summary>
        /// 删除 IM 用户[批量]的URL
        /// </summary>
        public static string UrlDeleteUsers
        {
            get { return string.Concat(UrlBase, "users?limit={0}"); }
        }

        /// <summary>
        /// 重置 IM 用户密码的URL
        /// </summary>
        public static string UrlRestPassword
        {
            get { return string.Concat(UrlBase, "users/{0}/password"); }
        }

        /// <summary>
        /// 修改用户昵称的URL
        /// </summary>
        public static string UrlRestNickName
        {
            get { return string.Concat(UrlBase, "users/{0}"); }
        }

        #endregion

        #region 好友与黑名单

        /// <summary>
        /// 给 IM 用户添加好友的URL
        /// </summary>
        public static string UrlAddFriend
        {
            get { return string.Concat(UrlBase, "users/{0}/contacts/users/{1}"); }
        }

        /// <summary>
        /// 解除 IM 用户的好友关系的URL
        /// </summary>
        public static string UrlDeleteFriend
        {
            get { return string.Concat(UrlBase, "users/{0}/contacts/users/{1}"); }
        }

        /// <summary>
        /// 查看好友的URL
        /// </summary>
        public static string UrlGetFriend
        {
            get { return string.Concat(UrlBase, "users/{0}/contacts/users"); }
        }

        /// <summary>
        /// 获取 IM 用户的黑名单的URL
        /// </summary>
        public static string UrlGetBlock
        {
            get { return string.Concat(UrlBase, "users/{0}/blocks/users"); }
        }

        /// <summary>
        /// 往 IM 用户的黑名单中加人的URL
        /// </summary>
        public static string UrlAddBlock
        {
            get { return string.Concat(UrlBase, "users/{0}/blocks/users"); }
        }

        /// <summary>
        /// 从 IM 用户的黑名单中减人的URL
        /// </summary>
        public static string UrlDeleteBlock
        {
            get { return string.Concat(UrlBase, "users/{0}/blocks/users/{1}"); }
        }

        #endregion

        #region 在线与离线

        /// <summary>
        /// 查看用户在线状态的URL
        /// </summary>
        public static string UrlGetStatus
        {
            get { return string.Concat(UrlBase, "users/{0}/status"); }
        }

        /// <summary>
        /// 查询离线消息数的URL
        /// </summary>
        public static string UrlGetOfflineMsgCount
        {
            get { return string.Concat(UrlBase, "users/{0}/offline_msg_count"); }
        }

        /// <summary>
        /// 查询某条离线消息状态的URL
        /// </summary>
        public static string UrlGetOfflineMsgStatus
        {
            get { return string.Concat(UrlBase, "users/{0}/offline_msg_status/{1}"); }
        }

        #endregion

        #region 账号禁用与解禁

        /// <summary>
        /// 用户账号禁用的URL
        /// </summary>
        public static string UrlSetUserDeactivate
        {
            get { return string.Concat(UrlBase, "users/{0}/deactivate"); }
        }

        /// <summary>
        /// 用户账号解禁的URL
        /// </summary>
        public static string UrlSetUserActivate
        {
            get { return string.Concat(UrlBase, "users/{0}/activate"); }
        }
        #endregion

        #region 强制用户下线

        /// <summary>
        /// 强制用户下线的URL
        /// </summary>
        public static string UrlSetUserDisconnect
        {
            get { return string.Concat(UrlBase, "users/{0}/disconnect"); }
        }

        #endregion

        #endregion

        #region 聊天记录

        #region 导出聊天记录

        /// <summary>
        /// 导出聊天记录的URL
        /// </summary>
        public static string UrlExportChatMsg
        {
            get { return string.Concat(UrlBase, "chatmessages?ql={0}&limit={1}&cursor={2}"); }
        }

        #endregion

        #endregion

        #region 发送消息

        /// <summary>
        /// 发送消息
        /// </summary>
        public static string UrlSendMsg
        {
            get { return string.Concat(UrlBase, "messages"); }
        }

        #endregion

        #region 文件上传下载

        /// <summary>
        /// 上传语音/图片文件
        /// </summary>
        public static string UrlUploadFiles
        {
            get { return string.Concat(UrlBase, "chatfiles"); }
        }

        /// <summary>
        /// 下载语音/图片文件
        /// </summary>
        public static string UrlDownloadFiles
        {
            get { return string.Concat(UrlBase, "chatfiles/{0}"); }
        }

        #endregion

        #region 群组管理

        #region 获取群组

        /// <summary>
        /// 获取 APP 中所有的群组
        /// 分页获取 APP 下的群组
        /// </summary>
        public static string UrlChatGroupsGet
        {
            get { return string.Concat(UrlBase, "chatgroups"); }
        }

        /// <summary>
        /// 分页获取 APP 下的群组
        /// </summary>
        public static string UrlChatGroupsGetByLimit
        {
            get { return string.Concat(UrlBase, "chatgroups?limit={0}&cursor={1}"); }
        }

        /// <summary>
        /// 获取群组详情
        /// 可以获取一个或多个群组的详情
        /// </summary>
        public static string UrlChatGroupsDetails
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}"); }
        }

        #endregion

        #region 管理群组

        /// <summary>
        /// 创建一个群组
        /// </summary>
        public static string UrlChatGroupsCreate
        {
            get { return string.Concat(UrlBase, "chatgroups"); }
        }

        /// <summary>
        /// 修改群组信息
        /// </summary>
        public static string UrlChatGroupsUpdate
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}"); }
        }

        /// <summary>
        /// 删除群组
        /// </summary>
        public static string UrlChatGroupsDelete
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}"); }
        }

        /// <summary>
        /// 获取群组所有成员
        /// </summary>
        public static string UrlChatGroupsMemberAll
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/users"); }
        }

        /// <summary>
        /// 添加群组成员[单个]
        /// </summary>
        public static string UrlChatGroupsMemberAdd
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/users/{1}"); }
        }

        /// <summary>
        /// 添加群组成员[批量]
        /// 为群组添加多个成员，一次最多可以添加60位成员。
        /// </summary>
        public static string UrlChatGroupsMemberAddBatch
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/users"); }
        }

        /// <summary>
        /// 移除群组成员[单个]
        /// </summary>
        public static string UrlChatGroupsMemberDelete
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/users/{1}"); }
        }

        /// <summary>
        /// 移除群组成员[批量]
        /// </summary>
        public static string UrlChatGroupsMemberDeleteBatch
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/users/{1}"); }
        }

        /// <summary>
        /// 获取一个用户参与的所有群组
        /// </summary>
        public static string UrlChatGroupsUser
        {
            get { return string.Concat(UrlBase, "users/{0}/joined_chatgroups"); }
        }

        /// <summary>
        /// 转让群组
        /// </summary>
        public static string UrlChatGroupsChange
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}"); }
        }

        #endregion

        #region 黑名单管理

        /// <summary>
        /// 查询群组黑名单
        /// </summary>
        public static string UrlChatGroupsBlock
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/blocks/users"); }
        }

        /// <summary>
        /// 添加用户至群组黑名单[单个]
        /// </summary>
        public static string UrlChatGroupsBlockAdd
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/blocks/users/{1}"); }
        }

        /// <summary>
        /// 添加用户至群组黑名单[批量]
        /// 添加多个用户进入一个群组的黑名单，一次性最多可以添加60个用户
        /// </summary>
        public static string UrlChatGroupsBlockAddBatch
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/blocks/users"); }
        }

        /// <summary>
        /// 从群组黑名单移除用户[单个]
        /// </summary>
        public static string UrlChatGroupsBlockDelete
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/blocks/users/{1}"); }
        }

        /// <summary>
        /// 从群组黑名单移除用户[批量]
        /// </summary>
        public static string UrlChatGroupsBlockDeleteBatch
        {
            get { return string.Concat(UrlBase, "chatgroups/{0}/blocks/users/{1}"); }
        }
        #endregion

        #endregion

        #region 聊天室管理

        #region 管理聊天室

        /// <summary>
        /// 创建聊天室
        /// </summary>
        public static string UrlChatRoomsCreate
        {
            get { return string.Concat(UrlBase, "chatrooms"); }
        }

        /// <summary>
        /// 修改聊天室信息
        /// </summary>
        public static string UrlChatRoomsUpdate
        {
            get { return string.Concat(UrlBase, "chatrooms/{0}"); }
        }

        /// <summary>
        /// 删除聊天室
        /// </summary>
        public static string UrlChatRoomsDelete
        {
            get { return string.Concat(UrlBase, "chatrooms/{0}"); }
        }

        /// <summary>
        /// 获取 APP 中所有的聊天室
        /// </summary>
        public static string UrlChatRoomsGet
        {
            get { return string.Concat(UrlBase, "chatrooms"); }
        }

        /// <summary>
        /// 获取一个聊天室详情
        /// </summary>
        public static string UrlChatRoomsDetails
        {
            get { return string.Concat(UrlBase, "chatrooms/{0}"); }
        }

        /// <summary>
        /// 获取用户加入的聊天室
        /// </summary>
        public static string UrlChatRoomsUserJoin
        {
            get { return string.Concat(UrlBase, "users/{0}/joined_chatrooms"); }
        }

        /// <summary>
        /// 添加聊天室成员[单个]
        /// </summary>
        public static string UrlChatRoomsUserAdd
        {
            get { return string.Concat(UrlBase, "chatrooms/{0}/users/{1}"); }
        }

        /// <summary>
        /// 添加聊天室成员[批量]
        /// </summary>
        public static string UrlChatRoomsUserBatchAdd
        {
            get { return string.Concat(UrlBase, "chatrooms/{0}/users"); }
        }

        /// <summary>
        /// 删除聊天室成员[单个]
        /// </summary>
        public static string UrlChatRoomsUserDelete
        {
            get { return string.Concat(UrlBase, "chatrooms/{0}/users/{1}"); }
        }

        /// <summary>
        /// 删除聊天室成员[批量]
        /// </summary>
        public static string UrlChatRoomsUserBatchDelete
        {
            get { return string.Concat(UrlBase, "chatrooms/{0}/users/{1}"); }
        }
        #endregion

        #endregion

        #endregion
    }
}
